package com.trickytriads.actions
{
	import com.trickytriads.events.GetAllGamesEvent;
	import com.trickytriads.services.interfaces.I_GameService;
	
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;

	/**
	 * Controller class for requests that involve GetAllGamesEvents.
	 */
	public class GetAllGamesAction extends EventDispatcher
	{
		[Inject]
		public var gameService:I_GameService;
		
		public function GetAllGamesAction(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		/**
		 * Handler for when a game request is dispatched.
		 */
		[MessageHandler(selector="getAllGamesRequest")]
		public function getAllGamesRequestHandler(evt:GetAllGamesEvent) : void
		{
			trace("Received getAllGamesRequest in GetAllGamesAction");
			gameService.getAllGamesRequest(evt);	
		}		
	}
}